feat(roles): Add support for arguments against roles subcommand - #764
Merged
platinummonkey merged 3 commits intoAug 25, 2026
Merged
Conversation
platinummonkey
approved these changes
Aug 25, 2026
Author
|
@platinummonkey It looks like everything is green, but I do not have the 'Merge Pull Request' button. Do I lack necessary permissions to merge this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Adds pagination and filtering support to the
pup users roles listcommand. The command previously called the paginated Datadog list-roles API but exposed no arguments, so callers were stuck with the API defaults and had no way to page through or filter results.The command now accepts
--page-size,--page-number,--sort,--filter, and--filter-id, mapping directly to the five fields on the API'sListRolesOptionalParams.Motivation
UserRoleActions::Listhit a paginated endpoint but had no pagination arguments, unlike sibling commands such asusers listandorganizations policies list. This meant users could only ever retrieve the first page of roles with no control over sorting or filtering. This change brings the command in line with the rest of the CLI's paginated list commands.Additional Notes
RolesSortenum andListRolesOptionalParamsbuilder from the pinneddatadog-api-client-rustcrate rather than introducing new types.Option-field conditional-set pattern already used inorganizations::policies_list(src/commands/organizations.rs) for consistency.--sortaccepts the API's documented tokens:name,-name,modified_at,-modified_at,user_count,-user_count. Invalid values return an explicit error.This validation lives in a
parse_roles_sorthelper rather than a clapValueEnum, matching howorganizations.rshandles its sort flag. Happy to switch it to clap-level validation if preferred.Checklist
Related Issues
N/A